(DEFUN C:RBUB ()
  (COMMAND "UNDO" "BEGIN")
  (SETQ OLD_CBUBOSMODE (GETVAR "OSMODE"))
  (COMMAND "DIMSCALE" 0)
  (COMMAND ".LTSCALE" 0.5)
  (C:SON)
  (vla-put-MSpace (vla-get-Activedocument (vlax-get-Acad-Object)) :vlax-true)
;;;  (COMMAND ".MSPACE")
  (COMMAND ".-XREF" "DETACH" "BASE-RAM")
  (COMMAND ".-LAYER" "M" "contours_10" "")
  (COMMAND ".-XREF" "OVERLAY" "..\\contours_10.dwg" "0,0" "1" "1" "0")
  (COMMAND ".-LAYER" "M" "sheet-layout-ai" "")
  (COMMAND ".-XREF" "OVERLAY" "..\\sheet-layout-ai.dwg" "0,0" "1" "1" "0")
  (COMMAND ".-LAYER" "M" "Base-WhipDixieSham" "")
  (COMMAND ".-XREF" "OVERLAY" "Base-WhipDixieSham.dwg" "0,0" "1" "1" "0")
  (COMMAND ".-LAYER" "M" "CFMPLX09" "")
  (COMMAND ".-XREF" "OVERLAY" "CFMPLX09.dwg" "0,0" "1" "1" "0")
  (vla-put-MSpace (vla-get-Activedocument (vlax-get-Acad-Object)) :vlax-false)
;;;  (COMMAND ".PSPACE")
  (COMMAND ".VIEWRES" "Y" 10000)
  (COMMAND ".LIMITS" "0,0" "34,22")
  (COMMAND ".-LAYER" "M" "C-VI017NPLT" "")
  (SETQ MYVPENT (SSGET "X" '((68 . 2)(0 . "VIEWPORT"))))
  (COMMAND ".VPCLIP" (SSNAME MYVPENT 0) "D")
  (PRINC "\nMove Viewport to correct layer:")
  (PRINC)
  (C:TOLAYER)
  (COMMAND ".-LAYER" "M" "C-VI016NOTE" "")
  (C:RXRLAY)
  (IF (SETQ C_BUB (SSGET "X"
                         '((-4 . "<AND")
                           (410 . "Model")
                           (-4 . "<OR")
                           (1 . "[A C G]")
                           (-4 . "<AND")
                           (0 . "CIRCLE")
                           (-4 . ">")
                           (40 . 6.6)
                           (-4 . "<")
                           (40 . 6.8)
                           (-4 . "AND>")
                           (-4 . "OR>")
                           (-4 . "AND>")
                          )
                  ) ;_ end of SSGET
      ) ;_ end of SETQ
    (PROGN
      (vla-put-MSpace (vla-get-Activedocument (vlax-get-Acad-Object)) :vlax-true)
;;;      (COMMAND ".MSPACE")
      (PRINC "\nSelect Previous to change to Paper Space: ")
      (PRINC)
      (C:CHSPACE)
      (vla-put-MSpace (vla-get-Activedocument (vlax-get-Acad-Object)) :vlax-false)
;;;      (COMMAND ".PSPACE")
    )
  ) ;_ end of IF
  (IF (SETQ C_BUB (SSGET "X" '((0 . "MTEXT")(-4 . "<OR")(1 . "###")(1 . "####")(1 . "[ACG]")(-4 . "OR>"))))
    (PROGN (SETQ BUB_CNT 0)
           (WHILE (< BUB_CNT (SSLENGTH C_BUB))
             (SETQ THIS_BUB (SSADD (SSNAME C_BUB BUB_CNT)))
             (COMMAND ".EXPLODE" THIS_BUB)
             (SETQ BUB_CNT (1+ BUB_CNT))
           ) ;_ end of WHILE
           (SETQ C_BUB (SSGET "X" '((0 . "TEXT")(67 . 1)(-4 . "<OR")(1 . "###")(1 . "####")(1 . "[ACG]")(-4 . "OR>"))))
           (PRINC "\nSelect Previous for text justification: ")
           (PRINC)
           (C:TXTJ)
    ) ;_ end of PROGN
  ) ;_ end of IF
  (COMMAND NIL NIL NIL)
  (COMMAND ".-LAYER" "M" "C-VI016NOTE" "C" "6" "C-VI016NOTE" "")
  (IF
    (SETQ C_BUB (SSGET "X" '((-4 . "<OR")(1 . "###")(1 . "####")(-4 . "<AND")(0 . "TEXT")(8 . "0")(-4 . "AND>")(-4 . "OR>"))))
    (PROGN
      (PRINC "\nSelect Previous for layer change: ")
      (PRINC)
      (C:TOLAYER)
    )
  )
  (COMMAND ".-INSERT" "STDNOTE" "26.4,12.3" "1" "1" "0")
  (SETVAR "OSMODE" 0)
  (SETQ C_BUB (SSGET "X" '((1 . "[ACG]"))))
  (SETQ C_BUBLEN (SSLENGTH C_BUB))
  (SETQ C_CNT 0)
  (WHILE (< C_CNT C_BUBLEN)
    (SETQ C_ENT (ENTGET (SSNAME C_BUB C_CNT)))
    (SETQ C_BUBPT (CDR (ASSOC 11 C_ENT)))
    (SETQ C_ATTR (CDR (ASSOC 1 C_ENT)))
    (SETVAR "ATTREQ" 1)
    (COMMAND ".-INSERT" "B_TAG" C_BUBPT "1" "1" "0" C_ATTR)
    (ENTDEL (SSNAME C_BUB C_CNT))
    (SETQ C_CNT (1+ C_CNT))
  ) ;_ end of WHILE
  (SETQ C_BUB (SSGET "X"
                     '((-4 . "<AND") (0 . "CIRCLE") (-4 . ">") (40 . 0.134) (-4 . "<") (40 . 0.135) (-4 . "AND>"))
              ) ;_ end of SSGET
  ) ;_ end of SETQ
  (SETQ C_BUBLEN (SSLENGTH C_BUB))
  (SETQ C_CNT 0)
  (WHILE (< C_CNT C_BUBLEN) (ENTDEL (SSNAME C_BUB C_CNT)) (SETQ C_CNT (1+ C_CNT)))
  (IF (SETQ C_BUB (SSGET "X" '((2 . "B_TAG"))))
    (PROGN
      (COMMAND ".PSPACE")
      (PRINC "\nSelect Previous TO change to Model Space: ")
      (PRINC)
      (C:CHSPACE)
      (COMMAND ".PSPACE")
    )
  ) ;_ end of IF
  (SETVAR "OSMODE" OLD_CBUBOSMODE)
  (COMMAND "UNDO" "END")
  (PRINC)
) ;_ end of DEFUN
(DEFUN C:FIXHOUSES ()
  (IF (SETQ C_BUB (SSGET "X" '((-4 . "<OR")(2 . "HOUSE")(2 . "TRAILER")(2 . "BUILDING")(2 . "CHURCH")(2 . "BARN")(2 . "CAMPER")(2 . "SHED")(2 . "BUSINESS")(2 . "BARN")(2 . "SHED")(2 . "STORAGE")(2 . "STORE")(-4 . "OR>"))))
    (PROGN (SETQ BUB_CNT 0)
           (WHILE (< BUB_CNT (SSLENGTH C_BUB))
             (SETQ THIS_BUB (SSADD (SSNAME C_BUB BUB_CNT)))
             (COMMAND ".EXPLODE" THIS_BUB)
             (SETQ BUB_CNT (1+ BUB_CNT))
           ) ;_ end of WHILE
           (SETQ C_BUB (SSGET "X" '((-4 . "<OR")(1 . "HOUSE")(1 . "TRAILER")(1 . "BUILDING")(1 . "CHURCH")(1 . "BARN")(1 . "CAMPER")(1 . "SHED")(1 . "BUSINESS")(1 . "BARN")(1 . "SHED")(1 . "STORAGE")(1 . "STORE")(-4 . "OR>"))))
           (COMMAND ".-LAYER" "M" "C-VI011NOTE" "C" "1" "C-VI011NOTE" "")
           (PRINC "\nSelect Previous for HOUSE layer change: ")
           (PRINC)
           (C:TOLAYER)
           (PRINC "\nSelect Previous for HOUSE text rotation fix: ")
           (PRINC)
           (C:RRTXT)
           (IF (SETQ C_BUB (SSGET "X" '((0 . "LINE") (8 . "0"))))
             (PROGN
               (SETQ C_BUBLEN (SSLENGTH C_BUB))
               (SETQ C_CNT 0)
               (WHILE (< C_CNT C_BUBLEN) (ENTDEL (SSNAME C_BUB C_CNT)) (SETQ C_CNT (1+ C_CNT)))
             )
           ) ;_ end of IF
    ) ;_ end of PROGN
  ) ;_ end of IF
) ;_ end of DEFUN
(defun c:fixrr ()
  (setq mstxt (ssget "x" '((-4 . "<and")(-4 . "<not")(67 . 1)(-4 . "not>")(0 . "text")(-4 . "and>"))))
  (vla-put-MSpace (vla-get-Activedocument (vlax-get-Acad-Object)) :vlax-true)
;;;  (COMMAND ".mspace")
  (PRINC "\nSelect Previous for standard text rotation fix: ")
  (PRINC)
  (C:RRTXT)
  (vla-put-MSpace (vla-get-Activedocument (vlax-get-Acad-Object)) :vlax-false)
;;;  (COMMAND ".pspace")
)
(DEFUN C:FLO ()
  (COMMAND ".UNDO" "BEGIN")
  (SETQ OLD_FLOW_OSMODE (GETVAR "OSMODE"))
  (SETVAR "OSMODE" 0)
;;;  (COMMAND ".mspace")
  (IF dimscl NIL (LOAD "DIMSCL" "\nFile DIMSCL.LSP not loaded! "))
  (dimscl)
  (IF UPOINT NIL (LOAD "UPOINT" "\File UPOINT.LSP not loaded! "))
  (SETQ IPT (UPOINT 0 "" "Insertion point" nil nil))
  (IF IPT
    (PROGN
      (COMMAND ".-INSERT" "FLONOTE" IPT DIMSC DIMSC PAUSE)
      (COMMAND ".EXPLODE" "L")
    )
  )
  (SETVAR "OSMODE" OLD_FLOW_OSMODE)
  (COMMAND ".UNDO" "END")
)
(DEFUN C:FLO1 ()
  (COMMAND ".UNDO" "BEGIN")
  (SETQ OLD_FLOW_OSMODE (GETVAR "OSMODE"))
  (SETVAR "OSMODE" 0)
;;;  (COMMAND ".mspace")
  (IF dimscl NIL (LOAD "DIMSCL" "\nFile DIMSCL.LSP not loaded! "))
  (dimscl)
  (IF UPOINT NIL (LOAD "UPOINT" "\File UPOINT.LSP not loaded! "))
  (SETQ IPT (UPOINT 0 "" "Insertion point" nil nil))
  (IF IPT
    (PROGN
      (COMMAND ".-INSERT" "FLONOTE1" IPT DIMSC DIMSC PAUSE)
      (COMMAND ".EXPLODE" "L")
    )
  )
  (SETVAR "OSMODE" OLD_FLOW_OSMODE)
  (COMMAND ".UNDO" "END")
)
(DEFUN C:FLO2 ()
  (COMMAND ".UNDO" "BEGIN")
  (SETQ OLD_FLOW_OSMODE (GETVAR "OSMODE"))
  (SETVAR "OSMODE" 0)
;;;  (COMMAND ".mspace")
  (IF dimscl NIL (LOAD "DIMSCL" "\nFile DIMSCL.LSP not loaded! "))
  (dimscl)
  (IF UPOINT NIL (LOAD "UPOINT" "\File UPOINT.LSP not loaded! "))
  (SETQ IPT (UPOINT 0 "" "Insertion point" nil nil))
  (IF IPT
    (PROGN
      (COMMAND ".-INSERT" "FLONOTE2" IPT DIMSC DIMSC PAUSE)
      (COMMAND ".EXPLODE" "L")
    )
  )
  (SETVAR "OSMODE" OLD_FLOW_OSMODE)
  (COMMAND ".UNDO" "END")
)
(SETQ C:FLOW C:FLO)
(SETQ C:FLOW1 C:FLO1)
(SETQ C:FLOW2 C:FLO2)